<!DOCTYPE html>
<html><!--<![endif]-->
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <title>档案管理系统</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1" name="viewport">
    <link href="${request.contextPath}/statics/css/bootstrap.min.css" rel="stylesheet" type="text/css">
    <link href="${request.contextPath}/statics/css/font-awesome.css" rel="stylesheet" type="text/css">
    <link href="${request.contextPath}/statics/css/components.css" rel="stylesheet" id="style_components"
          type="text/css">
    <link href="${request.contextPath}/statics/css/plugins.css" rel="stylesheet" type="text/css">
    <link href="${request.contextPath}/statics/css/login-5.css" rel="stylesheet" type="text/css">
    <script src="${request.contextPath}/statics/js/jquery.min.js" type="text/javascript"></script>

    <script src="/wedding_admin/js/vue_table/vue.min.js"></script>
    <script src="/wedding_admin/js/vue_table/vue-validator.min.js"></script>

</head>
<body class=" login">
<script>

    $(function () {
        $("#tsxx").hide() //隐藏
    });
    document.onkeydown = function (e) { // 回车提交表单
// 兼容FF和IE和Opera
        var theEvent = window.event || e;
        var code = theEvent.keyCode || theEvent.which || theEvent.charCode;
        if (code == 13) {

            login()
        }
    }

    function login(obj) {

        $(obj).attr("disabled", true);

        var username = $.trim($('#username').val());
        var password = $.trim($('#password').val());
        if (username == "" || password == "") {

            $("#tsxx").show() //显示
            $("#info").html('用户名或者密码不能为空');

            $(obj).attr("disabled", false);
        } else {
            $.ajax({
                type: 'post',
                url: 'sys/login',
                data: $("#login-form").serialize(),
                success: function (result) {

                    if (result.code == 0) {//登录成功
                        parent.location.href = 'index.html';
                    } else {
                        $("#tsxx").show() //显示
                        $("#info").html(result.msg);

                    }


                },
                error: function (xhr, textStatus, errorThrown) {
                    var msg = xhr.responseText;
                    var response = JSON.parse(msg);
                    $("#info").html(response.message);
                    $(obj).attr("disabled", false);
                }
            });

        }
    }
</script>
<style>
    .user-login-5 input:-webkit-autofill {
        -webkit-box-shadow: 0 0 0 1000px white inset !important;
    }


</style>
<!-- BEGIN : LOGIN PAGE 5-1 -->
<div class="user-login-5" id="rrapp">

    <div class="row bs-reset">
        <div class="col-md-6 bs-reset">
            <div class="login-bg" style="background: none; position: relative; z-index: 0;">
                <!--登陆页面背景图-->
                <img id="sys-logo-img"
                     style="position: absolute; margin: 0px; padding: 0px; border: none; width: 1015px; height: 946px; max-height: none; max-width: none; z-index: -999999; left: 0px; top: 10px;">


            </div>
        </div>
        <div class="col-md-6 login-container bs-reset">
            <div class="login-content">
                <!--标题-->
                <h1 id="sys_title"></h1>
                <div class="alert alert-danger" id="tsxx">
                    <button class="close" data-close="alert"></button>
                    <span id="info"></span>
                </div>
                <!--   action="${request.contextPath}/statics/picture" method="post"-->
                <form class="login-form" autocomplete="off" id="login-form">
                    <input type="password" hidden="">
                    <div class="row">
                        <div class="col-xs-12 col-sm-6">
                            <input class="form-control form-control-solid placeholder-no-fix" type="text"
                                   autocomplete="off" placeholder="用户名" name="username" id="username">
                        </div>
                        <div class="col-xs-12 col-sm-6">
                            <input type="password" style="display:none;width:0;height:0;">
                            <input id="password" type="password" id="password" autocomplete="new-password"
                                   name="password"
                                   class="form-control form-control-solid placeholder-no-fix " placeholder="密码">
                        </div>
                        <div class="col-xs-12 col-sm-6" id="yzm01">
                            <input class="form-control form-control-solid placeholder-no-fix" type="text"
                                   autocomplete="off" placeholder="验证码" name="captcha">
                        </div>
                        <div class="col-xs-12 col-sm-6" id="yzm02">
                            <img style="width: 150px;height: 33px" alt="如果看不清楚，请单击图片刷新！"
                                 src="${request.contextPath}/captcha.jpg"
                                 onclick="this.src=this.src+'?'"
                            >
                            <span>点击图片</span>

                        </div>
                    </div>

                    <div class="row">
                        <div class="col-sm-6" style="position:relative">
                        </div>
                        <div class="col-sm-6 text-right">

                            <button class="btn blue" type="button" d="loginBtn" onclick="login();"
                                    style="min-width:100px">登录
                            </button>
                        </div>
                    </div>
                </form>
            </div>
            <!--   <div class="login-footer">
                   <div class="row bs-reset">
                       <div class="col-xs-12 bs-reset">
                           <div class="login-copyright text-right">
                               <p> 1.</p>
                           </div>
                       </div>
                   </div>
               </div>-->
        </div>
    </div>
</div>
<!--[if lt IE 9]>
<script src="${request.contextPath}/statics/js/respond.min.js"></script>
<script src="${request.contextPath}/statics/js/excanvas.min.js"></script>
<![endif]-->
<script src="${request.contextPath}/statics/js/jquery.backstretch.min.js" type="text/javascript"></script>


<script type="text/javascript">

    var vm = new Vue({
        el: '#rrapp',
        data: {

            roleList: {},
            dict: {}

        },
        mounted() {
            //初始化执行方法

            this.getImgPath()


        },
        methods: {

            getImgPath: function () {


                $.ajax({
                    type: "GET",
                    url: "/wedding_admin/sys/sysdict/loginimgpathlist",
                    contentType: "application/json",
                    success: function (r) {

                        var faviconimg = "";
                        debugger
                        for (var i = 0; i < r.imgList.length; i++) {
                            //登陆页面图片
                            if (r.imgList[i].code == "dltp") {

                                faviconimg = r.imgList[i].value
                            }
                            //标题
                            if (r.imgList[i].code == "dlbt") {

                                $('#sys_title').html(r.imgList[i].value);
                            }
                            //是否启用验证码
                            if (r.imgList[i].code == "yzm") {

                                if (r.imgList[i].value == "1") {

                                    $('#yzm01').show();//显示
                                    $('#yzm02').show();
                                } else {
                                    $('#yzm01').hide();//隐藏+
                                    $('#yzm02').hide();


                                }

                            }

                        }

                        $("#sys-logo-img").attr("src", "/" + faviconimg);
                    }
                });

            },


        }
    })


</script>
</body>
</html>
